#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=2e5+5;

int t, n, a[N][26], m, k, ans, l, r;
char s[N];
int main() {
    scanf("%s", s + 1);
    n = strlen(s + 1);
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j <= 25; ++j) a[i][j] = a[i - 1][j];
        a[i][s[i] - 'a']++;
    }
    scanf("%d", &t);
    while (t--) {
        scanf("%d%d", &l, &r);
        if (s[l] != s[r] || l == r)
            printf("Yes\n");
        else {
            int cnt = 0;
            for (int i = 0; i <= 25; ++i)
                if (a[r][i] - a[l - 1][i]) cnt++;
            if (cnt > 2)
                printf("Yes\n");
            else
                printf("No\n");
        }
    }
}
